<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CORS跨域</title>
    <script src="jquery1.9/jquery-1.9.0.min.js"></script>
    <script>
        function loadData(){
            $.ajax({
                // url:"http://localhost/ajax/service/selectProductById_cors.php",
                // url:"http://127.0.0.1/ajax/service/selectProductById_cors.php",
                url:"http://192.168.22.148/ajax/day04/service/selecProductById.php",//李羽倩的
                // url:"http://192.168.22.187/ajax/service/selecProductById.php",//朱丽娜
                type:"post",
                dataType:"json",
                data:{id:1}
            }).done((result)=>{
                console.log("result:",result);
            });
        }
    </script>
</head>
<body>
    <input type="button" value="loadData" onclick="loadData()">
</body>
</html>